package com.xjt.java.thread;

public class MyThread implements Runnable {

	private int num=0;
	private boolean flag=true;
	@Override
	public void run() {
		while(flag){
		System.out.println(Thread.currentThread().getName()+"-->"+num++);
		}
	}
	public void stop(){
		this.flag=!this.flag;
		
	}
}
